// KSurface.h: interface for the KSurface class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_KSURFACE_H__82CC6F62_F2FC_4FAB_B29D_B0B43DC79716__INCLUDED_)
#define AFX_KSURFACE_H__82CC6F62_F2FC_4FAB_B29D_B0B43DC79716__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class KColor;

class KSurface  
{
public:
	KSurface(int w, int h);
	KSurface();
	~KSurface();
	
	bool Create(int w, int h);

	void SetPixel(int x, int y, COLORREF crColor);
	COLORREF GetPixel(int x, int y);
	void MoveTo(int x, int y);
	void LineTo(int x, int y, COLORREF crPen);
	
	int GetWidth() const { return m_iWidth; }
	int GetHeight() const { return m_iHeight; }
	
	void Fill(COLORREF crColor);

	void Display(CDC* pDC);

	KColor* GetScanLine(int nRow);
	KColor* NextScanLine(KColor* pkCurScanLine);

protected:
	int m_iWidth, m_iHeight;

	CDC m_dcMem;
	CBitmap m_bmpDraw;
};

#endif // !defined(AFX_KSURFACE_H__82CC6F62_F2FC_4FAB_B29D_B0B43DC79716__INCLUDED_)
